package com.roc.web.action.diaodan;

import java.io.File;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.TreeMap;

import org.apache.commons.io.FileUtils;
import org.apache.commons.lang.time.DateFormatUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.log4j.LogManager;
import org.apache.log4j.Logger;
import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.InterceptorRef;
import org.apache.struts2.convention.annotation.Namespace;
import org.apache.struts2.convention.annotation.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

import com.roc.page.BaseSearchCondition;
import com.roc.page.PaginationBaseAction; // import com.roc.pojo.Merchant;
import com.roc.pojo.AuditingItem;
import com.roc.pojo.BlackList;
import com.roc.pojo.DiaoDanBean;
import com.roc.pojo.EsmidinfoMerinfo;
import com.roc.pojo.Operators;
import com.roc.pojo.SettingBean;
import com.roc.service.IMerchantServices;
import com.roc.service.IPagenitionService; // import
import com.roc.service.IorgService;
import com.roc.service.ServiceException;
import com.roc.service.diaodan.IDiaodanService;
import com.roc.service.setting.ISettflagService;
import com.roc.util.Constance;
import com.roc.util.Utils;
import com.roc.util.constant.AuditingResultCodeType;
import com.roc.util.constant.AuditingType;
import com.roc.util.constant.Constant;
import com.roc.util.constant.Role;

/**
 * @author Feng haitao
 * 
 */
@Component
@Scope(BeanDefinition.SCOPE_PROTOTYPE)
@Namespace("/diaodan")
public class DiaoDanApplyAction extends PaginationBaseAction {

	/**
	 * 
	 */
	private static final long serialVersionUID = 5236170890634487270L;
	private Logger logger = LogManager.getLogger(DiaoDanApplyAction.class);
	private Operators operators;
	private List<Object> profitRsList = new ArrayList<Object>();
	private DiaoDanApplySearchCondition searchCondition;
	private String idd;
	private String msg;
	private DiaoDanBean diaoDanBean;

	@Autowired
	IMerchantServices merchantServices;
	@Autowired
	IPagenitionService pagenitionService;

	@Autowired
	IorgService orgService;
	@Autowired
	IDiaodanService diaodanService;
	@Autowired
	ISettflagService settflagserevice;
	private String batchno;
	private String merNo;
	private String etstermId;
	private String termtrace;
	private String etsdate;
	private String period;
	private String etstrace;
	private String reak;
	private String did;
	private String diaodantype;
	private File upload;
	private String uploadContentType;
	private String uploadFileName;
	private AuditingItem auditing;
	private String acountno;

	// 调单初始页面。

	@Action(value = "init", results = {
			@Result(name = "success", location = "/pages/diaodan/diaodanapply.jsp"),
			@Result(name = "login", location = "/pages/redirect.jsp"),
			@Result(name = "error", location = "/error.jsp") }

	)
	public String diaodaninit() throws Exception {

		return SUCCESS;
	}

	// 调单申请
	@Action(value = "diaodanapplysearch", results = {
			@Result(name = "success", location = "/pages/diaodan/diaodanapply.jsp"),
			@Result(name = "error", location = "/error.jsp"),
			@Result(name = "login", location = "/pages/redirect.jsp") })
	public String diaodanapplysearch() {
		Operators logingMerchant = (Operators) getSession().getAttribute(
				Constant.SESSION_LOGIN_MERCHANT);
		Map<String, Operators> merchantMap = new TreeMap<String, Operators>();

		try {

			if (searchCondition == null) {
				// addActionMessage("请输入相应的条件进行查询操作");
				return SUCCESS;
			}
			List<DiaoDanBean> diaodanlist = diaodanService
					.querySettingItemList(searchCondition);
			if (diaodanlist == null || diaodanlist.size() < 1) {
				addActionMessage("当前条件下匹配不到成功交易信息，请确认检索条件");
				return SUCCESS;
			}
			getRequest().setAttribute("diaodanlist", diaodanlist);

		} catch (Exception e) {
			logger.error(e.getMessage(), e);
			addActionError(e.getMessage());
		}
		return SUCCESS;
	}

	// 调单查询初始页面。

	@Action(value = "diaodansearchinit", results = {
			@Result(name = "success", location = "/pages/diaodan/diaodanlist.jsp"),
			@Result(name = "login", location = "/pages/redirect.jsp"),
			@Result(name = "error", location = "/error.jsp") }

	)
	public String diaodansearchinit() throws Exception {

		return SUCCESS;
	}

	// 调单查询
	@Action(value = "diaodansearch", results = {
			@Result(name = "success", location = "/pages/diaodan/diaodanlist.jsp"),
			@Result(name = "error", location = "/pages/setting/calculist.jsp"),
			@Result(name = "login", location = "/pages/redirect.jsp") })
	public String diaodansearch() {
		Operators logingMerchant = (Operators) getSession().getAttribute(
				Constant.SESSION_LOGIN_MERCHANT);

		Map<String, Operators> merchantMap = new TreeMap<String, Operators>();
		if (searchCondition == null) {
			searchCondition = (DiaoDanApplySearchCondition) getSearchConditionFromSession();
			if (searchCondition == null) {
				searchCondition = new DiaoDanApplySearchCondition();
			}
		}
		try {
			searchCondition.setStatus("1");
			// 系统管理员查看全部，代理只能看到本机构下的。
			searchCondition.setRoleType(logingMerchant.getRoleType());
			if (Constance.OPERATORS_FLAG_OEM.equals(logingMerchant.getFlag())) {
				if (Role.MERCHANT.getCode()
						.equals(logingMerchant.getRoleType())) {
					searchCondition.setMerNo(logingMerchant.getAccountNo());
				} else if (Role.AGENT.getCode().equals(
						logingMerchant.getRoleType())) {
					searchCondition.setAgentId(logingMerchant.getId());
				} else {
					searchCondition.setOrgCode(logingMerchant.getOrgCode());
				}
			}

			int rows = pagenitionService.countSQL(searchCondition);
			List<DiaoDanBean> settingList = new ArrayList<DiaoDanBean>();
			if (rows > 0) {
				searchRsList = pagenitionService.findAllSQL(searchCondition,
						calcuStart(getCurrentPage()), Constance.PAGE_MAX_SIZE);
				if (searchRsList != null && searchRsList.size() > 0) {
					Iterator iterator = searchRsList.iterator();
					while (iterator.hasNext()) {
						Object[] obj = (Object[]) iterator.next();
						DiaoDanBean sett = new DiaoDanBean();
						if (obj[0] != null && !"".equals(obj[0])) {
							sett.setOrgcode(obj[0].toString());
						}
						if (obj[1] != null && !"".equals(obj[1])) {
							sett.setAgentid(obj[1].toString());
						}
						if (obj[2] != null && !"".equals(obj[2])) {
							sett.setMerchantno(obj[2].toString());
						}
						if (obj[3] != null && !"".equals(obj[3])) {
							sett.setMerchantname(obj[3].toString());
						}
						if (obj[4] != null && !"".equals(obj[4])) {
							sett.setTransdate(obj[4].toString());
						}
						if (obj[5] != null && !"".equals(obj[5])) {
							sett.setTranstime(obj[5].toString());
						}
						if (obj[6] != null && !"".equals(obj[6])) {
							sett.setTermid(obj[6].toString());
						}
						if (obj[7] != null && !"".equals(obj[7])) {
							sett.setTermtrace(obj[7].toString());
						}
						if (obj[8] != null && !"".equals(obj[8])) {
							sett.setEtstrace(obj[8].toString());
						}
						if (obj[9] != null && !"".equals(obj[9])) {
							sett.setTransamt(Long.valueOf(obj[9].toString()));
						}
						if (obj[10] != null && !"".equals(obj[10])) {
							sett.setEtstrancode(obj[10].toString());
						}
						if (obj[11] != null && !"".equals(obj[11])) {
							sett.setRespcode(obj[11].toString());
						}
						if (obj[12] != null && !"".equals(obj[12])) {
							sett.setStatus(obj[12].toString());
						}
						if (obj[13] != null && !"".equals(obj[13])) {
							sett.setStartdate(obj[13].toString());
						}
						if (obj[14] != null && !"".equals(obj[14])) {
							sett.setSettleorderno(obj[14].toString());
						}
						if (obj[15] != null && !"".equals(obj[15])) {
							sett.setMcc(obj[15].toString());
						}
						if (obj[16] != null && !"".equals(obj[16])) {
							sett.setPeriod(obj[16].toString());
						}
						if (obj[17] != null && !"".equals(obj[17])) {
							sett.setAcctno(obj[17].toString());
						}
						if (obj[18] != null && !"".equals(obj[18])) {
							sett.setId(Long.valueOf(obj[18].toString()));
						}
						settingList.add(sett);
					}
				}
			}
			this.setTotalPage(this.calcuTotalPage(rows));
			getRequest().setAttribute("roleT", logingMerchant.getRoleType());
			getRequest().setAttribute("merNo", logingMerchant.getAccountNo());
			getRequest().setAttribute("agenid", searchCondition.getAgentId());
			getRequest().setAttribute(SEARCH_RS_LIST, searchRsList);
			getRequest().setAttribute("settingList", settingList);
			getRequest().setAttribute(CURRENT_PAGE, this.getCurrentPage());
			getRequest().setAttribute(TOTAOL_PAGE, this.getTotalPage());
			setSearchToConditionSession(searchCondition);

		} catch (ServiceException e) {

			logger.error(e.getMessage(), e);

		} catch (Exception e) {
			logger.error(e.getMessage(), e);

		}
		return SUCCESS;
	}

	public long[] listtoarry(List<Operators> list) {
		long[] st = new long[list.size()];
		for (int i = 0; i < list.size(); i++) {
			st[i] = list.get(i).getId();
		}
		return st;
	}

	// 调单详细信息
	@Action(value = "diaodantailsearch", results = {
			@Result(name = "success", location = "/pages/diaodan/diaodantail.jsp"),
			@Result(name = "error", location = "/pages/diaodan/diaodantail.jsp"),
			@Result(name = "login", location = "/pages/redirect.jsp") })
	public String diaodantailsearch() {
		Operators logingMerchant = (Operators) getSession().getAttribute(
				Constant.SESSION_LOGIN_MERCHANT);
		DiaoDanBean diaoDan = new DiaoDanBean();

		if (StringUtils.isNotBlank(did)) {
			diaoDan.setId(Long.valueOf(did));
		}
		try {
			diaoDan = diaodanService.queryDiaoDanBean(did);

			getRequest().setAttribute("diaoDan", diaoDan);
			getRequest().setAttribute("batchno", batchno);
		} catch (ServiceException e) {

			logger.error(e.getMessage(), e);

		} catch (Exception e) {
			logger.error(e.getMessage(), e);

		}
		return SUCCESS;
	}

	@Action(value = "diaodanapply", results = { @Result(name = "success", location = "/pages/diaodan/diaodanapplytail.jsp") })
	// 调单申请确认
	public String diaodanapply() throws Exception {
		Operators logingMerchant = (Operators) getSession().getAttribute(
				Constant.SESSION_LOGIN_MERCHANT);

		try {
			diaoDanBean = diaodanService.queryDiaoDanBean(termtrace, acountno);

			getRequest().setAttribute("diaoDan", diaoDanBean);
			getRequest().setAttribute("searchCondition", searchCondition);
		} catch (ServiceException e) {
			logger.error(e.getMessage(), e);
			addActionError(e.getMessage());
			return ERROR;
		} catch (Exception e) {
			logger.error(e.getMessage(), e);
			addActionError(e.getMessage());
			return ERROR;
		}
		return SUCCESS;
	}

	@Action(value = "diaodanapplyupdate", results = { @Result(name = "success", location = "/pages/diaodan/diaodanapply.jsp") })
	// 调单申请提交。
	public String diaodanapplyupdate() throws Exception {
		Operators logingMerchant = (Operators) getSession().getAttribute(
				Constant.SESSION_LOGIN_MERCHANT);
		// searchCondition.setMerNo(merNo);
		// searchCondition.setEtstermId(etstermId);
		// searchCondition.setTermtrace(termtrace);
		// searchCondition.setEtsdate(etsdate);
		// searchCondition.setPeriod(period);
		// searchCondition.setEtstrace(etstrace);
		// searchCondition.setAccountno(acountno);
		try {
			diaoDanBean = diaodanService.queryDiaoDanBean(termtrace, acountno);
			// 保存结算记录id；
			List<String> settidlist = new ArrayList<String>();
			AuditingItem auditing = new AuditingItem();
			// 编辑申请信息入表
			auditing.setAudit_code(AuditingType.DIAODAN_APPLY.getCode());
			auditing.setAudit_name(AuditingType.DIAODAN_APPLY.getName());
			auditing.setObj_Audited(diaoDanBean.getMerchantno());
			auditing.setOperators(logingMerchant.getAccountNo());
			// 状态，用来是否判断是否冻结了调单金额；没冻结完全为0，冻结完全为1；
			String stuts = "0";

			List<SettingBean> settlist = diaodanService.querySettinglist(merNo);
			double diaoamount = diaoDanBean.getTransamt();
			double diaomerfee = diaoDanBean.getMerfee();
			double diaocaclu = diaoDanBean.getCacluamount();
			double frozenamount = diaocaclu;

			String settid = "";
			for (SettingBean sett : settlist) {
				Double dou = (double) Math.round(Double.parseDouble(String
						.valueOf(sett.getMerchantsettleamt())) * 100 * 100) / 100;
				double settcaclu = Math.round(dou);
				// 调单金额大于
				if (frozenamount > settcaclu) {
					// 需要冻结的结算id保存下来。
					if ("".equals(settid)) {
						settid = String.valueOf(sett.getId());
					} else {
						settid = settid + "," + String.valueOf(sett.getId());
					}
					settidlist.add(String.valueOf(sett.getId()));
					frozenamount = frozenamount - settcaclu;
					stuts = "0";
				} else if (frozenamount == settcaclu) {
					// 如果调单金额 = 结算金额，记录结算记录id，跳出循环；
					if ("".equals(settid)) {
						settid = String.valueOf(sett.getId());
					} else {
						settid = settid + "," + String.valueOf(sett.getId());
					}
					settidlist.add(String.valueOf(sett.getId()));
					stuts = "1";
					frozenamount = frozenamount - settcaclu;
					break;
				} else if (frozenamount < settcaclu) {
					// 如果调单金额<结算金额，需要拆分结算记录，
					if ("".equals(settid)) {
						settid = String.valueOf(sett.getId());
					} else {
						settid = settid + "," + String.valueOf(sett.getId());
					}
					settidlist.add(String.valueOf(sett.getId()));
					stuts = "1";
					SettingBean newsett = copysett(sett);
					// 更新老的结算金额。
					sett.setMerchantsettleamt(frozenamount / 100);
					sett.setTotalamt(sett.getTotalamt()
							- (settcaclu - frozenamount) / 100);
					diaodanService.updatesett(sett);
					// 插入新拆分的结算记录；
					newsett
							.setMerchantsettleamt((settcaclu - frozenamount) / 100);
					newsett.setTotalamt((settcaclu - frozenamount) / 100);
					newsett.setMerchantfee(0);
					// 生成一个新的批次号。年月日时分秒+六位随机数
					Random r = new Random();
					Double d = r.nextDouble();
					String s = d + "";
					s = s.substring(3, 3 + 6);
					String time = "";
					Date dt = new Date();
					SimpleDateFormat sdf = new SimpleDateFormat(
							"yyyyMMddHHmmss");
					time = sdf.format(dt);
					String ordno = time + s;
					newsett.setOrderno(ordno);
					Date date = new Date();
					newsett.setDt_create(date);
					diaodanService.insertsett(newsett);
					break;
				}

			}
			Date cDate = new Date();
			diaoDanBean.setStartdate(DateFormatUtils.format(cDate, "yyyyMMdd"));
			diaoDanBean.setStatus(stuts);
			diaoDanBean.setReversal("0");
			diaoDanBean.setSettleorderno(settid);
			// 判断是否冻满。1为冻结满，0为未冻满；
			if ("1".equals(stuts)) {
				diaoDanBean.setDDamount(diaocaclu);
				diaoDanBean.setFrozenAmount(diaocaclu);
				diaoDanBean.setUnFrozenAmount(0);
			} else {
				diaoDanBean.setDDamount(diaocaclu);
				diaoDanBean.setFrozenAmount(diaocaclu - frozenamount);
				diaoDanBean.setUnFrozenAmount(frozenamount);
			}
			boolean b = diaodanService.diaodanApply(auditing, diaoDanBean, "0",
					settidlist);
			if (b) {
				addActionMessage("商户号【" + diaoDanBean.getMerchantno()
						+ "】调单申请成功");
			} else {
				addActionMessage("商户号【" + diaoDanBean.getMerchantno()
						+ "】调单申请失败");
			}
			// 同一个商户单月调单超过3次打入黑名单
			int i = diaodanService.queryblackcount(merNo);
			int j = Integer.valueOf(Utils.getConfigValue("diaodancount"));
			if (i > j) {
				EsmidinfoMerinfo Merinfo = merchantServices
						.queryEsmidinfoMerinfo(merNo);
				BlackList black = new BlackList();
				black.setCardNo(Merinfo.getCardNo());
				black.setLicenseNo(Merinfo.getBusinessLicences());
				black.setMid(merNo);
				black.setAddType("h4");
				String time = "";
				Date dt = new Date();
				SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
				time = sdf.format(dt);
				black.setDtCreate(time);
				black.setOperators(logingMerchant.getAccountNo());
				black.setAcctNo(Merinfo.getAccno());
				diaodanService.insertblacklist(black);
			}
			logger.info("------------------------------操作员【"
					+ logingMerchant.getAccountNo() + "】调单申请【"
					+ diaoDanBean.getMerchantno()
					+ "】成功！-----------------------------------");
		} catch (ServiceException e) {
			logger.error(e.getMessage(), e);
			addActionError(e.getMessage());
			return ERROR;
		} catch (Exception e) {
			logger.error(e.getMessage(), e);
			addActionError(e.getMessage());
			return ERROR;
		}
		return diaodanapplysearch();
	}

	public SettingBean copysett(SettingBean sett) throws ServiceException {
		SettingBean newsett = new SettingBean();
		if (sett != null) {
			String ss = settflagserevice.getsettid();
			newsett.setId(Long.valueOf(ss));
			newsett.setAccountname(sett.getAccountname());
			newsett.setAccountno(sett.getAccountno());
			newsett.setBankdeposit(sett.getBankdeposit());
			newsett.setBatchno(sett.getBatchno());
			newsett.setChanalfee(sett.getChanalfee());
			newsett.setDatapath(sett.getDatapath());
			newsett.setDeposino(sett.getDeposino());
			newsett.setFreezeflag(sett.getFreezeflag());
			newsett.setMerchantfee(sett.getMerchantfee());
			newsett.setMerchantname(sett.getMerchantname());
			newsett.setMerchantno(sett.getMerchantno());
			newsett.setMerchantsettleamt(sett.getMerchantsettleamt());
			newsett.setOrderno(sett.getOrderno());
			newsett.setOrgno(sett.getOrgno());
			newsett.setRemark(sett.getRemark());
			newsett.setSetdate(sett.getSetdate());
			newsett.setSettledate(sett.getSettledate());
			newsett.setSettleflag(sett.getSettleflag());
			newsett.setTotalamt(sett.getTotalamt());
			newsett.setTotalnum(sett.getTotalnum());
			newsett.setTransenddate(sett.getTransenddate());
			newsett.setTransstartdate(sett.getTransstartdate());
			newsett.setUserid(sett.getUserid());
			newsett.setAcctype(sett.getAcctype());
			newsett.setLoadflag(sett.getLoadflag());
			newsett.setHostbranthno(sett.getHostbranthno());
			newsett.setNeedsett(sett.getNeedsett());
			
			
		}
		return newsett;
	}

	@Action(value = "diaodanupdate", interceptorRefs = { @InterceptorRef(value = "rocDefaultStack", params = {
			"fileUpload.allowedExtensions", "jpg", "fileUpload.maximumSize",
			"100000000" }) }, results = { @Result(name = "success", location = "/pages/diaodan/diaodanlist.jsp") })
	// 调单完善
	public String diaodanupdate() throws Exception {
		Operators logingMerchant = (Operators) getSession().getAttribute(
				Constant.SESSION_LOGIN_MERCHANT);
		// 调用service层
		try {
			DiaoDanBean diaoDan = new DiaoDanBean();
			AuditingItem auditing = new AuditingItem();
			// 编辑申请信息入表
			auditing.setAudit_code(AuditingType.DIAODAN_WANSHAN.getCode());
			auditing.setAudit_name(AuditingType.DIAODAN_WANSHAN.getName());
			auditing.setObj_Audited(idd);
			auditing.setOperators(logingMerchant.getAccountNo());
			diaoDan = diaodanService.queryDiaoDanBean(idd);
			String stuts = "";

			diaoDan.setStatus(AuditingResultCodeType.DIAODANWANSHAN.getCode()); // 调单完善
			stuts = AuditingResultCodeType.DIAODANWANSHAN.getCode();
			long currTimes = System.currentTimeMillis();
			String st = addMerinfoImg(String.valueOf(currTimes));
			diaoDan.setTicket_url(st);
			String time = "";
			Date dt = new Date();
			SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
			time = sdf.format(dt);
			diaoDan.setEnddate(time);
			List<String> list = new ArrayList<String>();
			boolean b = diaodanService.diaodanApply(auditing, diaoDan, stuts,
					list);
			if (b) {
				addActionMessage("调单小票上传成功");
			} else {
				addActionMessage("调单小票上传失败");
			}
			logger.info("------------------------------操作员【"
					+ logingMerchant.getAccountNo() + "】完善调单信息【" + idd
					+ "】成功！-----------------------------------");
		} catch (ServiceException e) {
			logger.info("------------------------------操作员【"
					+ logingMerchant.getAccountNo() + "】完善调单信息【" + idd
					+ "】失败！-----------------------------------");
			logger.error(e.getMessage(), e);
			return ERROR;
		}
		return diaodansearch();
	}

	// 上传图片
	public String addMerinfoImg(String currTimes) {
		String basePath = getRequest().getScheme() + "://"
				+ getRequest().getServerName() + ":"
				+ getRequest().getServerPort() + "/" + "img/";
		String realpath = Utils.getConfigValue("mcc_img_path");
		String path = "";
		String type = "";
		try {
			if (upload != null) {
				type = uploadContentType.substring(uploadContentType
						.indexOf("/") + 1, uploadContentType.length());
			}
			File filepath = new File(realpath);
			if (!filepath.exists()) {
				filepath.mkdirs();
			}
			File targetFile = null;
			targetFile = new File(realpath, currTimes + "." + type);
			FileUtils.copyFile(upload, targetFile);
			path = basePath + currTimes + "." + type;
		} catch (Exception e) {
			e.printStackTrace();
			logger.error("上传图片失败了", e);
		}

		return path;

	}

	@Action(value = "reviewdiaodaninit", results = {
			@Result(name = "success", location = "/pages/diaodan/reviewdiaodanlist.jsp"),
			@Result(name = "login", location = "/pages/redirect.jsp"),
			@Result(name = "error", location = "/error.jsp") }

	)
	public String reviewdiaodaninit() throws Exception {

		return SUCCESS;
	}

	// 调单审核查询
	@Action(value = "reviewdiaodansearch", results = {
			@Result(name = "success", location = "/pages/diaodan/reviewdiaodanlist.jsp"),
			@Result(name = "error", location = "/pages/setting/calculist.jsp"),
			@Result(name = "login", location = "/pages/redirect.jsp") })
	public String reviewdiaodansearch() {
		Operators logingMerchant = (Operators) getSession().getAttribute(
				Constant.SESSION_LOGIN_MERCHANT);

		Map<String, Operators> merchantMap = new TreeMap<String, Operators>();
		if (searchCondition == null) {
			searchCondition = (DiaoDanApplySearchCondition) getSearchConditionFromSession();
			if (searchCondition == null) {
				searchCondition = new DiaoDanApplySearchCondition();
			}
		}
		try {
			searchCondition.setStatus("2");
			int rows = pagenitionService.countSQL(searchCondition);
			List<DiaoDanBean> settingList = new ArrayList<DiaoDanBean>();
			if (rows > 0) {
				searchRsList = pagenitionService.findAllSQL(searchCondition,
						calcuStart(getCurrentPage()), Constance.PAGE_MAX_SIZE);
				if (searchRsList != null && searchRsList.size() > 0) {
					Iterator iterator = searchRsList.iterator();
					while (iterator.hasNext()) {
						Object[] obj = (Object[]) iterator.next();
						DiaoDanBean sett = new DiaoDanBean();
						if (obj[0] != null && !"".equals(obj[0])) {
							sett.setOrgcode(obj[0].toString());
						}
						if (obj[1] != null && !"".equals(obj[1])) {
							sett.setAgentid(obj[1].toString());
						}
						if (obj[2] != null && !"".equals(obj[2])) {
							sett.setMerchantno(obj[2].toString());
						}
						if (obj[3] != null && !"".equals(obj[3])) {
							sett.setMerchantname(obj[3].toString());
						}
						if (obj[4] != null && !"".equals(obj[4])) {
							sett.setTransdate(obj[4].toString());
						}
						if (obj[5] != null && !"".equals(obj[5])) {
							sett.setTranstime(obj[5].toString());
						}
						if (obj[6] != null && !"".equals(obj[6])) {
							sett.setTermid(obj[6].toString());
						}
						if (obj[7] != null && !"".equals(obj[7])) {
							sett.setTermtrace(obj[7].toString());
						}
						if (obj[8] != null && !"".equals(obj[8])) {
							sett.setEtstrace(obj[8].toString());
						}
						if (obj[9] != null && !"".equals(obj[9])) {
							sett.setTransamt(Long.valueOf(obj[9].toString()));
						}
						if (obj[10] != null && !"".equals(obj[10])) {
							sett.setEtstrancode(obj[10].toString());
						}
						if (obj[11] != null && !"".equals(obj[11])) {
							sett.setRespcode(obj[11].toString());
						}
						if (obj[12] != null && !"".equals(obj[12])) {
							sett.setStatus(obj[12].toString());
						}
						if (obj[13] != null && !"".equals(obj[13])) {
							sett.setStartdate(obj[13].toString());
						}
						if (obj[14] != null && !"".equals(obj[14])) {
							sett.setSettleorderno(obj[14].toString());
						}
						if (obj[15] != null && !"".equals(obj[15])) {
							sett.setMcc(obj[15].toString());
						}
						if (obj[16] != null && !"".equals(obj[16])) {
							sett.setPeriod(obj[16].toString());
						}
						if (obj[17] != null && !"".equals(obj[17])) {
							sett.setAcctno(obj[17].toString());
						}
						if (obj[18] != null && !"".equals(obj[18])) {
							sett.setId(Long.valueOf(obj[18].toString()));
						}
						settingList.add(sett);
					}
				}
			}
			this.setTotalPage(this.calcuTotalPage(rows));
			getRequest().setAttribute("roleT", logingMerchant.getRoleType());
			getRequest().setAttribute("merNo", logingMerchant.getAccountNo());
			getRequest().setAttribute("agenid", searchCondition.getAgentId());
			getRequest().setAttribute(SEARCH_RS_LIST, searchRsList);
			getRequest().setAttribute("settingList", settingList);
			getRequest().setAttribute(CURRENT_PAGE, this.getCurrentPage());
			getRequest().setAttribute(TOTAOL_PAGE, this.getTotalPage());
			setSearchToConditionSession(searchCondition);

		} catch (ServiceException e) {

			logger.error(e.getMessage(), e);

		} catch (Exception e) {
			logger.error(e.getMessage(), e);

		}
		return SUCCESS;
	}

	// 调单详细信息
	@Action(value = "reviewdiaodantailsearch", results = {
			@Result(name = "success", location = "/pages/diaodan/reviewdiaodantail.jsp"),
			@Result(name = "error", location = "/pages/diaodan/diaodantail.jsp"),
			@Result(name = "login", location = "/pages/redirect.jsp") })
	public String reviewdiaodantailsearch() {
		Operators logingMerchant = (Operators) getSession().getAttribute(
				Constant.SESSION_LOGIN_MERCHANT);
		DiaoDanBean diaoDan = new DiaoDanBean();

		if (StringUtils.isNotBlank(idd)) {
			diaoDan.setId(Long.valueOf(idd));
		}
		try {
			diaoDan = diaodanService.queryDiaoDanBean(idd);

			Map auditingMap = new HashMap();
			auditingMap.put(AuditingResultCodeType.DIAODANPASS.getCode(),
					AuditingResultCodeType.DIAODANPASS.getName());
			auditingMap.put(AuditingResultCodeType.DIAODANREFUSE.getCode(),
					AuditingResultCodeType.DIAODANREFUSE.getName());
			getRequest().setAttribute("auditingMap", auditingMap);
			getRequest().setAttribute("diaoDan", diaoDan);
			getRequest().setAttribute("batchno", batchno);
		} catch (ServiceException e) {

			logger.error(e.getMessage(), e);

		} catch (Exception e) {
			logger.error(e.getMessage(), e);

		}
		return SUCCESS;
	}

	@Action(value = "reviewdiaodanupdate", results = { @Result(name = "success", location = "/pages/diaodan/reviewdiaodanlist.jsp") })
	// 调单审核
	public String reviewdiaodanupdate() throws Exception {
		Operators logingMerchant = (Operators) getSession().getAttribute(
				Constant.SESSION_LOGIN_MERCHANT);
		// 调用service层
		DiaoDanBean diaoDan = new DiaoDanBean();
		try {
			// 编辑申请信息入表
			auditing.setAudit_code(AuditingType.DIAODAN_REVIEW.getCode());
			auditing.setAudit_name(AuditingType.DIAODAN_REVIEW.getName());
			auditing.setObj_Audited(idd);
			auditing.setOperators(logingMerchant.getAccountNo());
			diaoDan = diaodanService.queryDiaoDanBean(idd);
			String stuts = "";

			List<String> list = new ArrayList<String>();

			// 当界面选择同意并且和枚举中的同意code相同时进行冻结。
			if (auditing.getResult_code().equals(
					AuditingResultCodeType.DIAODANPASS.getCode())) {
				diaoDan.setStatus(AuditingResultCodeType.DIAODANPASS.getCode()); // 调单审批通过
				stuts = AuditingResultCodeType.DIAODANPASS.getCode();
				// 审批通过后解冻结算列表。
				String s = diaoDan.getSettleorderno();
				if (StringUtils.isNotBlank(s)) {
					String[] st = s.split(",");
					for (int i = 0; i < st.length; i++) {
						String settid = st[i];
						list.add(settid);
					}
				}
			}
			if (auditing.getResult_code().equals(
					AuditingResultCodeType.DIAODANREFUSE.getCode())) {
				diaoDan.setStatus(AuditingResultCodeType.DIAODANREFUSE
						.getCode()); // 调单审批不通过
				stuts = AuditingResultCodeType.DIAODANREFUSE.getCode();
			}

			boolean b = diaodanService.diaodanApply(auditing, diaoDan, stuts,
					list);
			if (b) {

				addActionMessage("调单审核成功");
			} else {
				addActionMessage("调单审核失败");
			}
			logger.info("------------------------------操作员【"
					+ logingMerchant.getAccountNo() + "】调单审核【" + idd
					+ "】成功！-----------------------------------");
		} catch (ServiceException e) {
			logger.info("------------------------------操作员【"
					+ logingMerchant.getAccountNo() + "】调单审核【" + idd
					+ "】失败！-----------------------------------");
			logger.error(e.getMessage(), e);
			return ERROR;
		}
		return reviewdiaodansearch();
	}

	// 调单统计初始
	@Action(value = "diaodanStatisticinit", results = {
			@Result(name = "success", location = "/pages/diaodan/diaodanStatisticlist.jsp"),
			@Result(name = "login", location = "/pages/redirect.jsp"),
			@Result(name = "error", location = "/error.jsp") }

	)
	public String diaodanStatisticinit() throws Exception {

		return SUCCESS;
	}

	// 调单统计查询
	@Action(value = "diaodanStatisticsearch", results = {
			@Result(name = "success", location = "/pages/diaodan/diaodanStatisticlist.jsp"),
			@Result(name = "error", location = "/pages/diaodan/diaodanStatisticlist.jsp"),
			@Result(name = "login", location = "/pages/redirect.jsp") })
	public String diaodanStatisticsearch() {
		Operators logingMerchant = (Operators) getSession().getAttribute(
				Constant.SESSION_LOGIN_MERCHANT);

		Map<String, Operators> merchantMap = new TreeMap<String, Operators>();
		if (searchCondition == null) {
			searchCondition = (DiaoDanApplySearchCondition) getSearchConditionFromSession();
			if (searchCondition == null) {
				searchCondition = new DiaoDanApplySearchCondition();
			}
		}
		try {
			int rows = pagenitionService.countSQL(searchCondition);
			List<DiaoDanBean> settingList = new ArrayList<DiaoDanBean>();
			if (rows > 0) {
				searchRsList = pagenitionService.findAllSQL(searchCondition,
						calcuStart(getCurrentPage()), Constance.PAGE_MAX_SIZE);
				if (searchRsList != null && searchRsList.size() > 0) {
					Iterator iterator = searchRsList.iterator();
					while (iterator.hasNext()) {
						Object[] obj = (Object[]) iterator.next();
						DiaoDanBean sett = new DiaoDanBean();
						if (obj[0] != null && !"".equals(obj[0])) {
							sett.setOrgcode(obj[0].toString());
						}
						if (obj[1] != null && !"".equals(obj[1])) {
							sett.setAgentid(obj[1].toString());
						}
						if (obj[2] != null && !"".equals(obj[2])) {
							sett.setMerchantno(obj[2].toString());
						}
						if (obj[3] != null && !"".equals(obj[3])) {
							sett.setMerchantname(obj[3].toString());
						}
						if (obj[4] != null && !"".equals(obj[4])) {
							sett.setTransdate(obj[4].toString());
						}
						if (obj[5] != null && !"".equals(obj[5])) {
							sett.setTranstime(obj[5].toString());
						}
						if (obj[6] != null && !"".equals(obj[6])) {
							sett.setTermid(obj[6].toString());
						}
						if (obj[7] != null && !"".equals(obj[7])) {
							sett.setTermtrace(obj[7].toString());
						}
						if (obj[8] != null && !"".equals(obj[8])) {
							sett.setEtstrace(obj[8].toString());
						}
						if (obj[9] != null && !"".equals(obj[9])) {
							sett.setTransamt(Long.valueOf(obj[9].toString()));
						}
						if (obj[10] != null && !"".equals(obj[10])) {
							sett.setEtstrancode(obj[10].toString());
						}
						if (obj[11] != null && !"".equals(obj[11])) {
							sett.setRespcode(obj[11].toString());
						}
						if (obj[12] != null && !"".equals(obj[12])) {
							sett.setStatus(obj[12].toString());
						}
						if (obj[13] != null && !"".equals(obj[13])) {
							sett.setStartdate(obj[13].toString());
						}
						if (obj[14] != null && !"".equals(obj[14])) {
							sett.setSettleorderno(obj[14].toString());
						}
						if (obj[15] != null && !"".equals(obj[15])) {
							sett.setMcc(obj[15].toString());
						}
						if (obj[16] != null && !"".equals(obj[16])) {
							sett.setPeriod(obj[16].toString());
						}
						if (obj[17] != null && !"".equals(obj[17])) {
							sett.setAcctno(obj[17].toString());
						}
						if (obj[18] != null && !"".equals(obj[18])) {
							sett.setId(Long.valueOf(obj[18].toString()));
						}
						if (obj[19] != null && !"".equals(obj[19])) {
							sett.setDDamount(Long.valueOf(obj[19].toString()));
						}
						if (obj[20] != null && !"".equals(obj[20])) {
							sett.setFrozenAmount(Long.valueOf(obj[20]
									.toString()));
						}
						if (obj[21] != null && !"".equals(obj[21])) {
							sett.setUnFrozenAmount(Long.valueOf(obj[21]
									.toString()));
						}
						if (obj[22] != null && !"".equals(obj[22])) {
							sett.setReversal(obj[22].toString());
						}
						settingList.add(sett);
					}
				}
			}
			this.setTotalPage(this.calcuTotalPage(rows));
			getRequest().setAttribute("roleT", logingMerchant.getRoleType());
			getRequest().setAttribute("merNo", logingMerchant.getAccountNo());
			getRequest().setAttribute("agenid", searchCondition.getAgentId());
			getRequest().setAttribute(SEARCH_RS_LIST, searchRsList);
			getRequest().setAttribute("settingList", settingList);
			getRequest().setAttribute(CURRENT_PAGE, this.getCurrentPage());
			getRequest().setAttribute(TOTAOL_PAGE, this.getTotalPage());
			setSearchToConditionSession(searchCondition);

		} catch (ServiceException e) {

			logger.error(e.getMessage(), e);

		} catch (Exception e) {
			logger.error(e.getMessage(), e);

		}
		return SUCCESS;
	}

	// 调单撤销初始化
	@Action(value = "diaodanhandleinit", results = {
			@Result(name = "success", location = "/pages/diaodan/diaodanhandlelist.jsp"),
			@Result(name = "login", location = "/pages/redirect.jsp"),
			@Result(name = "error", location = "/error.jsp") }

	)
	public String diaodanhandleinit() throws Exception {

		return SUCCESS;
	}

	// 调单处理操作
	@Action(value = "diaodanhandle", results = {
			@Result(name = "success", location = "/pages/diaodan/diaodanhandlelist.jsp"),
			@Result(name = "error", location = "/pages/diaodan/diaodanhandlelist.jsp"),
			@Result(name = "login", location = "/pages/redirect.jsp") })
	public String diaodanhandlesearch() {
		Operators logingMerchant = (Operators) getSession().getAttribute(
				Constant.SESSION_LOGIN_MERCHANT);

		Map<String, Operators> merchantMap = new TreeMap<String, Operators>();
		if (searchCondition == null) {
			searchCondition = (DiaoDanApplySearchCondition) getSearchConditionFromSession();
			if (searchCondition == null) {
				searchCondition = new DiaoDanApplySearchCondition();
			}
		}
		searchCondition.setReversal("0");
		try {
			int rows = pagenitionService.countSQL(searchCondition);
			List<DiaoDanBean> settingList = new ArrayList<DiaoDanBean>();
			if (rows > 0) {
				searchRsList = pagenitionService.findAllSQL(searchCondition,
						calcuStart(getCurrentPage()), Constance.PAGE_MAX_SIZE);
				if (searchRsList != null && searchRsList.size() > 0) {
					Iterator iterator = searchRsList.iterator();
					while (iterator.hasNext()) {
						Object[] obj = (Object[]) iterator.next();
						DiaoDanBean sett = new DiaoDanBean();
						if (obj[0] != null && !"".equals(obj[0])) {
							sett.setOrgcode(obj[0].toString());
						}
						if (obj[1] != null && !"".equals(obj[1])) {
							sett.setAgentid(obj[1].toString());
						}
						if (obj[2] != null && !"".equals(obj[2])) {
							sett.setMerchantno(obj[2].toString());
						}
						if (obj[3] != null && !"".equals(obj[3])) {
							sett.setMerchantname(obj[3].toString());
						}
						if (obj[4] != null && !"".equals(obj[4])) {
							sett.setTransdate(obj[4].toString());
						}
						if (obj[5] != null && !"".equals(obj[5])) {
							sett.setTranstime(obj[5].toString());
						}
						if (obj[6] != null && !"".equals(obj[6])) {
							sett.setTermid(obj[6].toString());
						}
						if (obj[7] != null && !"".equals(obj[7])) {
							sett.setTermtrace(obj[7].toString());
						}
						if (obj[8] != null && !"".equals(obj[8])) {
							sett.setEtstrace(obj[8].toString());
						}
						if (obj[9] != null && !"".equals(obj[9])) {
							sett.setTransamt(Long.valueOf(obj[9].toString()));
						}
						if (obj[10] != null && !"".equals(obj[10])) {
							sett.setEtstrancode(obj[10].toString());
						}
						if (obj[11] != null && !"".equals(obj[11])) {
							sett.setRespcode(obj[11].toString());
						}
						if (obj[12] != null && !"".equals(obj[12])) {
							sett.setStatus(obj[12].toString());
						}
						if (obj[13] != null && !"".equals(obj[13])) {
							sett.setStartdate(obj[13].toString());
						}
						if (obj[14] != null && !"".equals(obj[14])) {
							sett.setSettleorderno(obj[14].toString());
						}
						if (obj[15] != null && !"".equals(obj[15])) {
							sett.setMcc(obj[15].toString());
						}
						if (obj[16] != null && !"".equals(obj[16])) {
							sett.setPeriod(obj[16].toString());
						}
						if (obj[17] != null && !"".equals(obj[17])) {
							sett.setAcctno(obj[17].toString());
						}
						if (obj[18] != null && !"".equals(obj[18])) {
							sett.setId(Long.valueOf(obj[18].toString()));
						}
						if (obj[19] != null && !"".equals(obj[19])) {
							sett.setDDamount(Long.valueOf(obj[19].toString()));
						}
						if (obj[20] != null && !"".equals(obj[20])) {
							sett.setFrozenAmount(Long.valueOf(obj[20]
									.toString()));
						}
						if (obj[21] != null && !"".equals(obj[21])) {
							sett.setUnFrozenAmount(Long.valueOf(obj[21]
									.toString()));
						}
						if (obj[22] != null && !"".equals(obj[22])) {
							sett.setReversal(obj[22].toString());
						}
						settingList.add(sett);
					}
				}
			}
			this.setTotalPage(this.calcuTotalPage(rows));
			getRequest().setAttribute("roleT", logingMerchant.getRoleType());
			getRequest().setAttribute("merNo", logingMerchant.getAccountNo());
			getRequest().setAttribute("agenid", searchCondition.getAgentId());
			getRequest().setAttribute(SEARCH_RS_LIST, searchRsList);
			getRequest().setAttribute("settingList", settingList);
			getRequest().setAttribute(CURRENT_PAGE, this.getCurrentPage());
			getRequest().setAttribute(TOTAOL_PAGE, this.getTotalPage());
			setSearchToConditionSession(searchCondition);

		} catch (ServiceException e) {

			logger.error(e.getMessage(), e);

		} catch (Exception e) {
			logger.error(e.getMessage(), e);

		}
		return SUCCESS;
	}
	@Action(value = "diaodanhandleapply", results = { @Result(name = "success", location = "/pages/diaodan/diaodanhandleapply.jsp") })
	// 调单申请确认
	public String diaodanhandleapply() throws Exception {
		Operators logingMerchant = (Operators) getSession().getAttribute(
				Constant.SESSION_LOGIN_MERCHANT);
		try {
			diaoDanBean = diaodanService.queryDiaoDanBean(idd);
			List<SettingBean> settlist= new ArrayList<SettingBean>();
			if(diaoDanBean.getSettleorderno()!=null&&!"".equals(diaoDanBean.getSettleorderno())){
				settlist = diaodanService.querySettlist(diaoDanBean.getSettleorderno());
			}
			 
			getRequest().setAttribute("diaoDan", diaoDanBean);
			getRequest().setAttribute("settlist", settlist);
			getRequest().setAttribute("searchCondition", searchCondition);
		} catch (ServiceException e) {
			logger.error(e.getMessage(), e);
			addActionError(e.getMessage());
			return ERROR;
		} catch (Exception e) {
			logger.error(e.getMessage(), e);
			addActionError(e.getMessage());
			return ERROR;
		}
		return SUCCESS;
	}
	// 调单处理提交。
	@Action(value = "diaodanhandleupdate", results = { @Result(name = "success", location = "/pages/diaodan/diaodanhandlelist.jsp") })
	public String diaodanhandleupdate() throws Exception {
		Operators logingMerchant = (Operators) getSession().getAttribute(
				Constant.SESSION_LOGIN_MERCHANT);
		try {
			diaoDanBean = diaodanService.queryDiaoDanBean(idd);
			AuditingItem auditing = new AuditingItem();
			// 编辑申请信息入表
			auditing.setAudit_code(AuditingType.DIAODAN_HANDLE.getCode());
			auditing.setAudit_name(AuditingType.DIAODAN_HANDLE.getName());
			auditing.setObj_Audited(diaoDanBean.getMerchantno());
			auditing.setOperators(logingMerchant.getAccountNo());
			// 状态，用来是否判断是否冻结了调单金额；没冻结完全为0，冻结完全为1；

			diaoDanBean.setReversal("1");
			Date cDate = new Date();
			diaoDanBean.setEnddate(DateFormatUtils.format(cDate, "yyyyMMdd"));

			boolean b = diaodanService.diaodanHandle(auditing, diaoDanBean);
			if (b) {
				addActionMessage("商户号【" + diaoDanBean.getMerchantno()
						+ "】调单处理成功");
			} else {
				addActionMessage("商户号【" + diaoDanBean.getMerchantno()
						+ "】调单处理失败");
			}
			// 同一个商户单月调单超过3次打入黑名单

			logger.info("------------------------------操作员【"
					+ logingMerchant.getAccountNo() + "】调单处理【"
					+ diaoDanBean.getMerchantno()
					+ "】成功！-----------------------------------");
		} catch (ServiceException e) {
			logger.error(e.getMessage(), e);
			addActionError(e.getMessage());
			return ERROR;
		} catch (Exception e) {
			logger.error(e.getMessage(), e);
			addActionError(e.getMessage());
			return ERROR;
		}
		return diaodanhandleinit();
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.roc.page.PaginationBaseAction#getSearchConditionFromSession()
	 */
	@Override
	protected BaseSearchCondition getSearchConditionFromSession() {
		// TODO Auto-generated method stub
		return (DiaoDanApplySearchCondition) getSession().getAttribute(
				SEARCH_SESSION_BEAN_DIAODAN);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.roc.page.PaginationBaseAction#getSearchConditionFromSubClass()
	 */
	@Override
	protected BaseSearchCondition getSearchConditionFromSubClass()
			throws Exception {
		// TODO Auto-generated method stub
		return searchCondition;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.roc.page.PaginationBaseAction#setSearchConditionToSubClass(com.roc.page.BaseSearchCondition)
	 */
	@Override
	protected void setSearchConditionToSubClass(
			BaseSearchCondition searchCondition) throws Exception {
		this.setSearchConditionToSubClass(searchCondition);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.roc.page.PaginationBaseAction#setSearchToConditionSession(com.roc.page.BaseSearchCondition)
	 */
	@Override
	protected void setSearchToConditionSession(
			BaseSearchCondition searchCondition) {
		getSession().setAttribute(SEARCH_SESSION_BEAN_DIAODAN, searchCondition);
	}

	public DiaoDanApplySearchCondition getSearchCondition() {
		return searchCondition;
	}

	public void setSearchCondition(DiaoDanApplySearchCondition searchCondition) {
		this.searchCondition = searchCondition;
	}

	/**
	 * @return the msg
	 */
	public String getMsg() {
		return msg;
	}

	/**
	 * @param msg
	 *            the msg to set
	 */
	public void setMsg(String msg) {
		this.msg = msg;
	}

	/**
	 * @return the profitRsList
	 */
	public List<Object> getProfitRsList() {
		return profitRsList;
	}

	/**
	 * @param profitRsList
	 *            the profitRsList to set
	 */
	public void setProfitRsList(List<Object> profitRsList) {
		this.profitRsList = profitRsList;
	}

	/**
	 * @return the profitModelHead
	 */

	public Operators getOperators() {
		return operators;
	}

	public void setOperators(Operators operators) {
		this.operators = operators;
	}

	@Override
	protected String getInitPageSize() {
		// TODO Auto-generated method stub
		return null;
	}

	public String getBatchno() {
		return batchno;
	}

	public void setBatchno(String batchno) {
		this.batchno = batchno;
	}

	public String getMerNo() {
		return merNo;
	}

	public void setMerNo(String merNo) {
		this.merNo = merNo;
	}

	public String getIdd() {
		return idd;
	}

	public void setIdd(String idd) {
		this.idd = idd;
	}

	public DiaoDanBean getDiaoDanBean() {
		return diaoDanBean;
	}

	public void setDiaoDanBean(DiaoDanBean diaoDanBean) {
		this.diaoDanBean = diaoDanBean;
	}

	public String getDid() {
		return did;
	}

	public void setDid(String did) {
		this.did = did;
	}

	public File getUpload() {
		return upload;
	}

	public void setUpload(File upload) {
		this.upload = upload;
	}

	public String getUploadContentType() {
		return uploadContentType;
	}

	public void setUploadContentType(String uploadContentType) {
		this.uploadContentType = uploadContentType;
	}

	public String getUploadFileName() {
		return uploadFileName;
	}

	public void setUploadFileName(String uploadFileName) {
		this.uploadFileName = uploadFileName;
	}

	public AuditingItem getAuditing() {
		return auditing;
	}

	public void setAuditing(AuditingItem auditing) {
		this.auditing = auditing;
	}

	public String getEtstermId() {
		return etstermId;
	}

	public void setEtstermId(String etstermId) {
		this.etstermId = etstermId;
	}

	public String getTermtrace() {
		return termtrace;
	}

	public void setTermtrace(String termtrace) {
		this.termtrace = termtrace;
	}

	public String getEtsdate() {
		return etsdate;
	}

	public void setEtsdate(String etsdate) {
		this.etsdate = etsdate;
	}

	public String getPeriod() {
		return period;
	}

	public void setPeriod(String period) {
		this.period = period;
	}

	public String getEtstrace() {
		return etstrace;
	}

	public void setEtstrace(String etstrace) {
		this.etstrace = etstrace;
	}

	public String getReak() {
		return reak;
	}

	public void setReak(String reak) {
		this.reak = reak;
	}

	public String getDiaodantype() {
		return diaodantype;
	}

	public void setDiaodantype(String diaodantype) {
		this.diaodantype = diaodantype;
	}

	public String getAcountno() {
		return acountno;
	}

	public void setAcountno(String acountno) {
		this.acountno = acountno;
	}

}
